
program chapter5_18
    print *, 'please input n'
    read *, n
    j=sqrt(real(n))
    i=2
    !do 10, until ((i .GT. J) .OR. (mod(n,i) .EQ. 0))
    !    i=i+1
    !10 continue
    ! seems no until statement
10 i=i+1
    if ((i .LE. j) .AND. (mod(n,i) .NE. 0)) goto 10

    if (i .GT. j) then
        print *, n, 'is a prime number'
    else
        print *, n, 'is  not a prime number'
    end if

end program

